home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
language
/
embedded
/
develop
/
symcoff.arc
/
PLSHREAD.C
< prev
next >
Wrap
Text File
|
1988-11-07
|
2KB
|
44 lines
static char *sccsid[]={"@(#)pldshread.c 2.1",
"Copyright 1985 by Motorola Inc."};
#include <stdio.h>
#ifdef PCPORT
#include "/pld/src/hd/pcport.h" /*PC-PORT*/
#endif
#include "../hd/pfilehdr.h"
#include "../hd/pscnhdr.h"
#include "../hd/pldfcn.h"
#include "../hd/pldf_dcl.h" /*PC-PORT*/
/****************** PLDSHREAD ******************************************gs##*/
/* ##*/
/* ##*/
/* Written by: Michael Greenberg - MIL ##*/
/* ##*/
/* ACTION: ##*/
/* Read an indexed section header of a common object file. ##*/
/* ##*/
/* SYNOPSIS: ##*/
int pldshread(ldptr, sectindx, secthead) /*##*/
/* ---------------------------------------- ##*/
register LDFILE *ldptr; /*##*/
register unsigned short sectindx; /*##*/
register SCNHDR *secthead; /*##*/
/* ##*/
/*************************************************************************##*/
{
register long disp;
if(sectindx > HEADER(ldptr).f_nscns)
return(FAILURE);
disp = OFFSET(ldptr) + FILHSZ + HEADER(ldptr).f_opthdr; /* skip headers */
disp += SCNHSZ * ((int) sectindx - 1); /* skip section headers */
if(fseek(IOPTR(ldptr), disp, 0) != 0)
return(FAILURE);
if(fread(secthead, SCNHSZ, 1, IOPTR(ldptr)) != 1)
return(FAILURE);
return(SUCCESS);
}
/* Copyright 1985 by Motorola Inc. */